A hybrid coding framework, for example, a video coding standard such as H.264/AVC, H.265/HEVC, or AVS, is usually used for video coding. The hybrid coding framework mainly includes steps of prediction, transform, quantization, entropy coding, loop deblocking filtering, and the like.
For example, a high efficiency video coding (HEVC) standard uses a block-based hybrid coding framework with prediction and transform. In HEVC, a to-be-coded video may be divided into an I-frame, a P-frame, and a B-frame. Coding of the I-frame is intra-frame coding. Coding of the P-frame and the B-frame is inter-frame coding. There are block-based coding modes for both inter-frame coding and intra-frame coding. In HEVC, a picture is divided into blocks by using coding tree units (CTUs) as basic units. A CTU is further divided into coding units (CUs) in a form of a quadtree. During prediction and transform, a CU is used as a root node and further divided into prediction units (PUs) and transform units (TUs).
Block-based transform coding is widely applied in picture compression coding. As a bit rate is reduced, quantization becomes coarse, discontinuity occurs at boundaries of blocks, and obvious defects are formed in a reconstructed picture. This phenomenon of discontinuity between picture blocks is referred to as a blocking artifact.
In conventional deblocking, a deblocking filter is usually used. The deblocking filter may first compute a filtering offset value of a pixel located at a boundary of a block, and filter a pixel value of the pixel according to the filtering offset value. However, in a signal filtered according to this method, a local waveform gradient may increase. Consequently, a location of a maximum waveform gradient may change, and overall smoothness of the signal is reduced.